" Define my alphabet and dictionary {{{1
let g:#autoCaps#alphabet = { "a": "A", "b": "B", "c": "C", "d": "D", "e": "E", "f": "F",
  \ "g": "G", "h": "H", "i": "I", "j": "J", "k": "K", "l": "L", "m": "M",
  \ "n": "N", "o": "O", "p": "P", "q": "Q", "r": "R", "s": "S", "t": "T",
  \ "u": "U", "v": "V", "w": "W", "x": "X", "y": "Y", "z": "Z",
  \ "jl": "<esc>"
  \ }
let g:#autoCaps#dictionary = {
  \ "i": "I",
  \ "english": "English",
  \ "china": "China",
  \ "jane": "Jane",
  \ "homer": "Homer",
  \ "jeremy": "Jeremy",
  \ "yvonne": "Yvonne",
  \ "kirk": "Kirk",
  \ "ke": "Ke",
  \ "tang": "Tang",
  \ "christmas": "Christmas",
  \ "christ": "Christ"
  \ "google": "Google"
  \ "facebook": "Facebook"
  \ }

" Enable Automatically upper case letters {{{1
function EnableAutoUpperCaseFunction()
  for [lower, upper] in items(g:#autoCaps#alphabet)
    " Automatically upper case after periods
    exe "inoremap .<space>".lower." . ".upper
    " Automatically upper case after question marks
    exe "inoremap ?<space>".lower." ? ".upper
    " Automatically upper case after exclamation marks
    exe "inoremap !<space>".lower." ! ".upper
    " Automatically upper case after line breaks
    exe "inoremap <cr>".lower." <cr>".upper
    " Automatically upper case after line breaks with o
    exe "nnoremap o".lower." o".upper
    " Automatically upper case after line breaks with O
    exe "nnoremap O".lower." O".upper
  endfor

  for [lower, upper] in items(g:#autoCaps#dictionary)
    " English abbreviations
    exe "inoreabbrev ".lower." ".upper
  endfor
endfunction

command! EnableAutoUpperCase silent! call EnableAutoUpperCaseFunction()

" Disable Automatically upper case letters {{{1
function DisableAutoUpperCaseFunction()
  for [lower, upper] in items(g:#autoCaps#alphabet)
    " Automatically upper case after periods
    exe "iunmap .<space>".lower
    " Automatically upper case after question marks
    exe "iunmap ?<space>".lower
    " Automatically upper case after exclamation marks
    exe "iunmap !<space>".lower
    " Automatically upper case after line breaks
    exe "iunmap <cr>".lower
    " Automatically upper case after line breaks with o
    exe "nunmap o".lower
    " Automatically upper case after line breaks with O
    exe "nunmap O".lower
  endfor

  for [lower, upper] in items(g:#autoCaps#dictionary)
    " English abbreviations
    exe "iunabbrev ".lower
  endfor
endfunction

command! DisableAutoUpperCase silent! call DisableAutoUpperCaseFunction()

